Skip to content

BatchCentering and BatchLipNorm classes compatible with multi-GPU - #54

Merged
franckma31 merged 18 commits into
developfrom
feature/batchlipnorm
Mar 16, 2026
Merged

BatchCentering and BatchLipNorm classes compatible with multi-GPU #54
franckma31 merged 18 commits into
developfrom
feature/batchlipnorm

Conversation

@franckma31

Copy link
Copy Markdown
Collaborator
  • BatchCentering support for multi-GPU training, based on a running_mean accumulator and a running_num_batches (implemented as a special case of batchLipNorm class)
  • BatchLipNorm compute the variance on batch and full set by using running means of square. This layer is not Lipschitz and can be used with a SharedLipFactory to maintain the global Lipschitz constant
  • Vanilla export for BatchCentering and BatchLipNorm with the layer ScaleBiasLayer
  • pytests on BatchCentering and BatchLipNorm
  • LipschitzModule class inherits from ScaledLipschitzModule to be able to register the coefficient_lip to a SharedLipFactory
  • multigpu tests are excluded from pytest : use torchrun on a multigpu config to run tests/multigpu scripts

@franckma31
franckma31 requested review from cofri and thib-s January 28, 2026 14:48
Comment thread deel/torchlip/modules/module.py Outdated
Comment thread deel/torchlip/modules/normalization.py Outdated
Comment thread deel/torchlip/modules/normalization.py
Comment thread deel/torchlip/modules/normalization.py
Comment thread deel/torchlip/modules/normalization.py Outdated
Comment thread deel/torchlip/modules/normalization.py Outdated
Comment thread deel/torchlip/modules/normalization.py Outdated
Comment thread deel/torchlip/modules/normalization.py Outdated
Comment thread deel/torchlip/modules/normalization.py
Comment thread deel/torchlip/modules/normalization.py Outdated

@cofri cofri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good to me!

@franckma31
franckma31 merged commit bfd01fd into develop Mar 16, 2026
15 of 18 checks passed
@franckma31
franckma31 deleted the feature/batchlipnorm branch March 16, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants